Skip to content

fix(workflow): resolve hyphens in ${{ params.X }} identifiers#12

Merged
igor-ctrl merged 1 commit into
mainfrom
fix/resolver-hyphen-param-names
May 8, 2026
Merged

fix(workflow): resolve hyphens in ${{ params.X }} identifiers#12
igor-ctrl merged 1 commit into
mainfrom
fix/resolver-hyphen-param-names

Conversation

@igor-ctrl
Copy link
Copy Markdown
Owner

Summary

The workflow template resolver matched only [\w.]+ in identifier names, so any ${{ params.<key> }} reference with a hyphen in the key — e.g. ${{ params.vendor-no }} — was left in the rendered filter as a literal token. The bug affects:

  • saved queries (bcli q) using hyphenated param names like vendor-no, customer-id, header-id
  • batch workflows (bcli batch) using the same template engine

When the literal ${{ params.X }} reaches BC inside a $filter expression, the server either 400s with a confusing length/parse error or, in some cases, simply returns no rows — both silent failure modes that are hard to attribute back to the resolver.

What changed

  • Add \- to the identifier character class in both REFERENCE_PATTERN and FULL_REFERENCE_PATTERN (src/bcli/workflow/_resolver.py)
  • Regression test covering both embedded and full-string substitution with hyphenated keys (tests/test_workflow/test_resolver.py::test_hyphenated_param_name)
  • CHANGELOG entry under Unreleased / Fixed

No public API change. Existing all-word param names continue to behave identically.

Test plan

  • uv run pytest tests/test_workflow/test_resolver.py — 28 pass
  • uv run pytest tests/ — 529 pass, 1 skipped
  • Manual: bcli q purchase-orders-by-vendor vendor-no=V00099 --show now renders filter: buyFromVendorNumber eq 'V00099' (was: filter: buyFromVendorNumber eq '${{ params.vendor-no }}')

The template resolver regex matched only [\w.]+, so any reference
with a hyphen in the identifier — e.g. ${{ params.vendor-no }} —
was left as a literal token in the rendered filter. The bug
silently affected long-running saved queries (vendor-no, customer-id,
header-id) and also any batch workflow using hyphenated param names.

Add hyphen to the identifier character class in both REFERENCE_PATTERN
and FULL_REFERENCE_PATTERN, plus a regression test that exercises both
the embedded and full-string substitution paths.
@igor-ctrl igor-ctrl merged commit 391a8cd into main May 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant